package com.training.java.core.collections.post15;

import java.util.Set;
import java.util.TreeSet;

import com.training.java.core.collections.post15.Car;

/**
 * This demo is to observe the list behavior on car Different cars are added to
 * the list and the list is read
 * 
 * @author soumya
 * 
 */
public class CarDemo {

	public static void main(String[] args) {
		Car Honda = new Car("Honda", "Accord", "1234", true);
		Car Toyota = new Car("Toyota", "Corrolla", "5467", false);
		Car Chevy = new Car("Chevy", "Volt", "4321", true);
		Car Toyota2 = new Car("Toyota", "Corrolla", "5467", false);
		Car Toyota3 = new Car("Toyota", "Corrolla", "467", false);

		Set<Car> cars = new TreeSet<>();

		// adding to the list

		cars.add(Honda);
		cars.add(Toyota);
		cars.add(Chevy);
		cars.add(Toyota2);
		cars.add(Toyota3);

		for (Car car : cars) {

			System.out.println("Car make is " + car.getMake());
			System.out.println("Car model is " + car.getModel());
			System.out.println("Car vinNumber is " + car.getVinNumber());
			System.out.println(" ");

		}

	}

}
